home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kdeprint / kmjobviewer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.5 KB  |  128 lines

  1. /*
  2.  *  This file is part of the KDE libraries
  3.  *  Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
  4.  *
  5.  *  This library is free software; you can redistribute it and/or
  6.  *  modify it under the terms of the GNU Library General Public
  7.  *  License version 2 as published by the Free Software Foundation.
  8.  *
  9.  *  This library is distributed in the hope that it will be useful,
  10.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  *  Library General Public License for more details.
  13.  *
  14.  *  You should have received a copy of the GNU Library General Public License
  15.  *  along with this library; see the file COPYING.LIB.  If not, write to
  16.  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.  *  Boston, MA 02110-1301, USA.
  18.  **/
  19.  
  20. #ifndef KMJOBVIEWER_H
  21. #define KMJOBVIEWER_H
  22.  
  23. #if !defined( _KDEPRINT_COMPILE ) && defined( __GNUC__ )
  24. #warning internal header, do not use except if you are a KDEPrint developer
  25. #endif
  26.  
  27. #include <kmainwindow.h>
  28. #include "kmprinterpage.h"
  29. #include "kpreloadobject.h"
  30.  
  31. class KMJobManager;
  32. class KMJob;
  33. class KListView;
  34. class JobItem;
  35. class QPopupMenu;
  36. class QListViewItem;
  37. class KMPrinter;
  38. class QTimer;
  39. class QLineEdit;
  40. class QCheckBox;
  41.  
  42. /**
  43.  * @internal
  44.  * This class is internal to KDEPrint and is not intended to be
  45.  * used outside it. Please do not make use of this header, except
  46.  * if you're a KDEPrint developer. The API might change in the
  47.  * future and binary compatibility might be broken.
  48.  */
  49. class KDEPRINT_EXPORT KMJobViewer : public KMainWindow, public KMPrinterPage, public KPReloadObject
  50. {
  51.     Q_OBJECT
  52. public:
  53.     KMJobViewer(QWidget *parent = 0, const char *name = 0);
  54.     ~KMJobViewer();
  55.  
  56.     void setPrinter(const QString& prname);
  57.     void setPrinter(KMPrinter *p);
  58.     void refresh(bool reload = false);
  59.     QString printer() const;
  60.     bool isSticky() const;
  61.  
  62. signals:
  63.     void jobsShown(KMJobViewer*, bool hasJobs);
  64.     void refreshClicked();
  65.     void printerChanged(KMJobViewer*, const QString& prname);
  66.     void viewerDestroyed(KMJobViewer*);
  67.  
  68. public slots:
  69.     void pluginActionActivated(int);
  70.  
  71. protected slots:
  72.     void slotSelectionChanged();
  73.     void slotHold();
  74.     void slotResume();
  75.     void slotRemove();
  76.     void slotRestart();
  77.     void slotRightClicked(QListViewItem*,const QPoint&,int);
  78.     void slotMove(int prID);
  79.     void slotPrinterSelected(int);
  80.     void slotShowCompleted(bool);
  81.     void slotRefresh();
  82.     void slotClose();
  83.     void slotShowMoveMenu();
  84.     void slotShowPrinterMenu();
  85.     void slotUserOnly(bool);
  86.     void slotUserChanged();
  87.     void slotConfigure();
  88.     void slotDropped( QDropEvent*, QListViewItem* );
  89.  
  90. protected:
  91.     void init();
  92.     void updateJobs();
  93.     void initActions();
  94.     JobItem* findItem(const QString& uri);
  95.     void jobSelection(QPtrList<KMJob>& l);
  96.     void send(int cmd, const QString& name, const QString& arg = QString::null);
  97.     void loadPrinters();
  98.     void loadPluginActions();
  99.     void removePluginActions();
  100.     void reload();
  101.     //void aboutToReload();
  102.     void closeEvent(QCloseEvent*);
  103.     void triggerRefresh();
  104.     void addToManager();
  105.     void removeFromManager();
  106.     void buildPrinterMenu(QPopupMenu *menu, bool use_all = false, bool use_specials = false);
  107.     void updateCaption();
  108.     void updateStatusBar();
  109.  
  110. private:
  111.     KListView        *m_view;
  112.     QPtrList<KMJob>        m_jobs;
  113.     QPtrList<JobItem>        m_items;
  114.     QPopupMenu        *m_pop;
  115.     QPtrList<KMPrinter>    m_printers;
  116.     QString    m_prname;
  117.     int    m_type;
  118.     QString    m_username;
  119.     QLineEdit    *m_userfield;
  120.     QCheckBox    *m_stickybox;
  121.     bool m_standalone;
  122. };
  123.  
  124. inline QString KMJobViewer::printer() const
  125. { return m_prname; }
  126.  
  127. #endif
  128.